package com.example.mall.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.example.mall.entity.User

@Dao
interface UserDao {
    @Insert
    fun insert(vararg user : User)

    @Delete
    fun delete(vararg user : User)

    @Query("delete from User")
    fun deleteAll()

    @Update
    fun update(vararg user : User)

    @Query("select * from User")
    fun queryAll(): List<User>

    @Query("select * from User where phone = :phone")
    fun queryByPhone(phone: String) : User



}